<html>
<head>
<script src="http://www.bloomberg.com/jscommon/calculators/finance.js" language="javascript"></script>
<script src="http://www.bloomberg.com/jscommon/calculators/mktscurrcalc.js" language="javascript"></script>
<script src="http://www.bloomberg.com/jscommon/calculators/currdata.js" language="javascript"></script>
<script type="text/javascript">
function calculate() 
{
    var select1 = document.currcalc.from_tkc;  
    var select2 = document.currcalc.to_tkc;    
    var select1_text = select1[select1.selectedIndex].text;
    var select2_text = select2[select2.selectedIndex].text;
    var fromval;    //Value of the currency to be converted
    var toval;        //Value of the currency to convert into
    //These error messages are hidden values in the HTML page
    //They get translated into foreign languages
    var errmsg1 = document.currcalc.translation1.value;
    var errmsg2 = document.currcalc.translation2.value;
    var errmsg3 = document.currcalc.translation3.value;
      //calculate the fixed Euro value
     if (select1_text.match(/\(EUR\)/) != null)
     { 
         var temp = select2_text.split("(");
         var lastsplit = temp.length - 1;
         var result = temp[lastsplit].match(/(FRF|ATS|PTE|ESP|BEF|NLG|FIM|DEM|IEP|ITL|LUF|GRD)/);
         if (result != null)
         {
            fromval = 1;
            toval = eurovals[result[0]];
         }
     }
     
      //calculate the fixed Euro value
     if (select2_text.match(/\(EUR\)/) != null)
     {
         var tmp = select1_text.split("(");
        var lstsplit = tmp.length - 1;
        var result = tmp[lstsplit].match(/(FRF|ATS|PTE|ESP|BEF|NLG|FIM|DEM|IEP|ITL|LUF|GRD)/);
         if (result != null)
         {
            toval = 1;
            fromval = eurovals[result[0]];
        }
     }
     
     //set the prices
     if (fromval == null && toval == null)            
     {
           fromval = price[select1[select1.selectedIndex].value];
          toval = price[select2[select2.selectedIndex].value];
         
     }
     
     //check to make sure that there is a valid price/ valid currency for each
     if ((fromval < 0) || (fromval == "") || isNaN(fromval) || (toval < 0) || (toval == "") || isNaN(toval)){
        alert(errmsg1);
        return false;
     }
    //assign the amount and check that it is valid, remove any punctuation 
    //amount is the number of the base currency units specified by the user
    var amount = document.currcalc.amount.value;
    if ((amount == "") || isNaN(amount) || (amount == 0) || (amount < 1)){ 
         alert(errmsg2);
        document.currcalc.amount.focus();
        return false;
    }
       var pattern = /,/g;
       amount = amount.replace(pattern, "");
    
    //show all results
    ShowResult(fromval, toval, amount);
}
//window.onload = calculate;
</script>
</head>
<body>
<div align="center"> </div>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#B9B5B6">
<div id="crncycalc"> 
<form name="currcalc" onSubmit="calculate(); return false;">
<input type=HIDDEN name="flag" value=0>
<input type=HIDDEN name="result" value=1>
<input type=HIDDEN name="d_list" value=1>
<input type=HIDDEN name="version" value="us">
<input type=HIDDEN name="exp2" value="us1">
<input type=HIDDEN name="displayres" value=" GBP">
<input type=HIDDEN name="disptkc" value="British Pound">
<input type=HIDDEN name=T value="markets_curr99.ht">
<input type=HIDDEN name=TZ>
<input type=HIDDEN name="translation" value="">
<input type=HIDDEN name="translation1" value="您的选择出现了一点问题，请重新选择两种货币再试。">
<input type=HIDDEN name="translation2" value="请输入一个合法的货币数量。">
<input type=HIDDEN name="translation3" value="该转换工具只能在 Netscape Navigator 或者 Microsoft Internet Explorer 4.0 以上版本中使用。">
<tr bgcolor="#FFFFFF"> 
<td style="padding-top:5px;padding-bottom:5px;padding-left:10px">
<table width="200" cellspacing="0" cellpadding="3" border="0" align="center">
<tr>
<td nowrap>
<div align="center">
<div align="left">
兑换数量:<input type="textbox" name="amount" value="100.00" size="15" style="width:115px">
</div>
<select name="from_tkc" size="1" style="width:115px">
<option value="">选择货币 
<option value="JPY:CUR" selected>日元(JPY) 
<option value="CNY:CUR">人民币(CNY) 
<option value="HKD:CUR">港币(HKD) 
<option value="TWD:CUR">台币(TWD) 
<option value="">-------------------- 
<option value="GBP:CUR">英镑(GBP) 
<option value="CAD:CUR">加元(CAD) 
<option value="EUR:CUR">欧元(EUR) 
<option value="USD:CUR">美元(USD) 
<option value="BEF:CUR">比利时法郎(BEF) 
<option value="DKK:CUR">丹麦克朗(DKK) 
<option value="NLG:CUR">荷兰盾(NLG) 
<option value="FRF:CUR">法国法郎(FRF) 
<option value="AUD:CUR">澳元(AUD) 
<option value="DEM:CUR">德国马克(DEM) 
<option value="ITL:CUR">意大利里拉(ITL) 
<option value="CHF:CUR">瑞士法郎(CHF) 
<option value="SGD:CUR">新加坡元(SGD) 
</select>
<select name="to_tkc" size="1" style="width:115px">
<option value="">选择货币 
<option value="JPY:CUR">日元(JPY) 
<option value="CNY:CUR" selected>人民币(CNY) 
<option value="HKD:CUR">港币(HKD) 
<option value="TWD:CUR">台币(TWD) 
<option value="">-------------------- 
<option value="GBP:CUR">英镑(GBP) 
<option value="CAD:CUR">加元(CAD) 
<option value="EUR:CUR">欧元(EUR) 
<option value="USD:CUR">美元(USD) 
<option value="BEF:CUR">比利时法郎(BEF) 
<option value="DKK:CUR">丹麦克朗(DKK) 
<option value="NLG:CUR">荷兰盾(NLG) 
<option value="FRF:CUR">法国法郎(FRF) 
<option value="AUD:CUR">澳元(AUD) 
<option value="DEM:CUR">德国马克(DEM) 
<option value="ITL:CUR">意大利里拉(ITL) 
<option value="CHF:CUR">瑞士法郎(CHF) 
<option value="SGD:CUR">新加坡元(SGD) 
</select>
<input type="button" name="cal" value="开始兑换" onClick="calculate()">
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor=#F7F7F7> 
<td align="center">
<script language="Javascript">loadResults();
calculate();
</script>
</td>
</tr>
</form>
</div>
</table>
</body>
</html>